﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;


namespace SpriterRuntime
{
    /// <remarks/>


    public partial class SpriterData
    {

        // character sprite atlas
        [ContentSerializer]
        public Texture2D texture = null;

        // list of location of individual sprites on the atlas
        [ContentSerializer]
        public List<List<Rectangle>> ImageRectangles = new List<List<Rectangle>>();

        /// <remarks/>
        [ContentSerializer]
        public List<SpriterFolder> folders;

        /// <remarks/>
        [ContentSerializer]
        public List<SpriterEntity> entities;

        /// <remarks/>
        [ContentSerializer]
        public string scml_version;

        /// <remarks/>
        [ContentSerializer]
        public string generator;

        /// <remarks/>
        [ContentSerializer]
        public string generator_version;

        [ContentSerializer]
        public bool pixel_art_mode;
    }

    /// <remarks/>

    public partial class SpriterFolder
    {

        /// <remarks/>
        [ContentSerializer]
        public List<SpriterFolderFile> file;

        /// <remarks/>
        [ContentSerializer]
        public int FolderId;

        /// <remarks/>
        [ContentSerializer]
        public string FolderName;
    }

    /// <remarks/>


    public partial class SpriterFolderFile
    {

        /// <remarks/>
        [ContentSerializer]
        public int FileId;

        /// <remarks/>
        [ContentSerializer]
        public string FileName;

        /// <remarks/>
        [ContentSerializer]
        public int width;

        /// <remarks/>
        [ContentSerializer]
        public int height;
    }

    /// <remarks/>

 
    public partial class SpriterEntity
    {

        /// <remarks/>
        [ContentSerializer]
        public List<SpriterEntityAnimation> animations;

        /// <remarks/>
        [ContentSerializer]
        public int EntityId;

        /// <remarks/>
        [ContentSerializer]
        public string EntityName;
    }

    /// <remarks/>

 



    public partial class SpriterEntityAnimation
    {

        /// <remarks/>
        [ContentSerializer]
        public List<SpriterKeyFrame> mainline;

        /// <remarks/>
        [ContentSerializer]
        public List<SpriterTimeline> Timelines;

        /// <remarks/>
        [ContentSerializer]
        public int AnimationId;

        /// <remarks/>
        [ContentSerializer]
        public string AnimationName;

        /// <remarks/>
        [ContentSerializer]
        public int length;

        /// <remarks/>
        [ContentSerializer]
        public bool looping;
    }

    /// <remarks/>

  
    public partial class SpriterKeyFrame
    {
        /// <remarks/>
        [ContentSerializer]
        public int KeyId;

        /// <remarks/>
        [ContentSerializer]
        public ushort time;

        [ContentSerializer]
        public List<SpriterBoneTimelineKeyMapping> bone_refs;
        /// <remarks/>

        [ContentSerializer]
        public List<SpriterObjectTimelineKeyMapping> object_refs;

       
    }

    /// <remarks/>


    public partial class SpriterBoneTimelineKeyMapping
    {
        /// <remarks/>
        [ContentSerializer(ElementName = "BoneId")]
        public int BoneId;

        [ContentSerializer(ElementName = "KeyId")]
        public int KeyId;

        [ContentSerializer(ElementName = "ParentId")]
        public int ParentId { get; set; }

        [ContentSerializer(ElementName = "ParentIdSpecified")]
        public bool ParentIdSpecified;

        [ContentSerializer(ElementName = "TimelineId")]
        public int TimelineId;

        [ContentSerializerIgnore]
        public Matrix Transform;

        [ContentSerializerIgnore]
        public Vector2 tween_scale;

        [ContentSerializerIgnore]
        public float tween_rotation;
    }


    public partial class SpriterObjectTimelineKeyMapping
    {

        /// <remarks/>
        [ContentSerializer]
        public int ObjectId;

        [ContentSerializer]
        public int ParentId { get; set; }

        [ContentSerializer]
        public bool ParentIdSpecified;
        /// <remarks/>
        [ContentSerializer]
        public int TimelineId;

        /// <remarks/>
        [ContentSerializer]
        public int KeyId;

        /// <remarks/>
        [ContentSerializer]
        public int z_index;
    }

    /// <remarks/>





    public partial class SpriterTimeline
    {

        /// <remarks/>
        [ContentSerializer]
        public List<SpriterTimelineKey> keys;

        /// <remarks/>
        [ContentSerializer]
        public int TimelineId;
    }

    /// <remarks/>





    public partial class SpriterTimelineKey
    {

        /// <remarks/>
        [ContentSerializer]
        public SpriterTimelineKeyObject KeyObject;

        /// <remarks/>
        [ContentSerializer]
        public SpriterTimelineKeyBone KeyBone;

        /// <remarks/>
        [ContentSerializer]
        public int KeyId;

        /// <remarks/>
        [ContentSerializer]
        public sbyte spin;

        /// <remarks/>
        [ContentSerializer]
        public int time;
    }

    /// <remarks/>




    //SpriterEntityAnimationTimelineKeyObject
    public partial class SpriterTimelineKeyObject
    {
        //object_type	string
        //atlas	        int
        //folder	    int
        //file	        int
        //usage	        string
        //blend_mode	string
        //name	        string
        //x	            float
        //y	            float
        //pivot_x	    float
        //pivot_y	    float
        //angle	        float
        //w	            float
        //h	            float
        //scale_x	    float
        //scale_y	    float
        //r	            float
        //g	            float
        //b	            float
        //a	            float
        //variable_type	string
        //value	        variable_type
        //min	        variable_type
        //max	        variable_type
        //animation	    int
        //t	            float
        //z_index	    int
        //volume	    float
        //panning	    float

        /// <remarks/>
        [ContentSerializer]
        public int FolderId;

        /// <remarks/>
        [ContentSerializer]
        public int FileId;

        [ContentSerializer]
        public Vector2 Position;

         [ContentSerializer]
        public Vector2 Pivot;
        [ContentSerializer]
        public Vector2 scale;

        [ContentSerializer]
        public float angle;

        [ContentSerializer]
        public float opacity;


    }
    //SpriterEntityAnimationTimelineKeyObject
    public partial class SpriterTimelineKeyBone
    {
        [ContentSerializer]
        public Vector2 Position;

        [ContentSerializer]
        public Vector2 scale;

        [ContentSerializer]
        public float angle;

        [ContentSerializer]
        public float opacity;
    }
}
